Repository navigation
Native player main thread 3-7 ms faster on Midway: held batch decision + render thread on by default (PRD-613) - #577
Conversation
…PRD-743 surface) PRD-743 added IAssetLoader.cache, prefetch and startBackgroundFill, and the playtest bridge's state sample reads cache.enabled. The native player's loader had none of them, so every native playtest observation threw TN_INSPECT_GAME_BRIDGE (reading 'enabled'), and a game passing assets.cache or assets.backgroundFill threw TN_NATIVE_ASSET_OPTIONS_UNSUPPORTED. The native loader now reports the cache as disabled with core's native reason, and prefetch and the fill resolve at once. Red-green: native_engine_player_imports red on the options refusal, green after.
… structure does RenderDatabase::batch judged a projecting projection decision again every frame: a full scene walk, content classes and the group maps, only to read the rigs' verdicts. On Midway that was about 11% of main-thread samples at cockpit and rear gunner. The decision now holds while hierarchyVersion and structureStamp (moved from the bindings into projection/plan.h, shared with hostProjectionReport) hold, and while every rig's lane key (lane reason, similarity, mirror sign) holds; the 60-frame cadence still re-judges it. TN_BATCH_DECISION_CACHE=0 (diagnostic) restores the old cadence for paired arms. ctest: skinned_projecting_cadence red then green; skinned_crowd_cpu caught the rig-scale and material cases; native-engine label 516/517 (target_graph is the UI-overlay configure).
Phase 3 passed on Midway at 99ad82d: main-thread CPU per frame falls by 3.4-7.5 ms per pose in three alternating pairs (render thread plus the held batch decision against today's develop path), parity PASS in every run, no steady-state fallback, visual judge NEUTRAL at all three poses. TN_RENDER_THREAD=0 turns it off; a GPU timing run keeps it off, since it has no synchronized timing snapshot (TN_RENDER_THREAD=1 with GPU timing still fails closed). Red: a Midway flight with the variable unset on the binary before this change reports no renderThreadCpuMs.
Pixels unchanged: visual judge NEUTRAL (PRD-613 Phase 3)Panels, left to right: BEFORE A1 and BEFORE A2 ( Verdict (fresh read-only Opus subagent, criteria set before judging): NEUTRAL at all three poses. No missing objects and no change to pose, material, shadow or flicker. Pixel counts over 1% grey, across 7 off-runs and 10 on-runs:
Follow-up outside this PRD: some state at those two spots is sampled off the fixed-step clock. |
dflt-green (render thread on with no flag, after the switch) reports renderThreadCpuMs in 4,574 frame lines, fallbacks 1, parity PASS; dflt-red on 99ad82d reports none. The PRD moves to docs/PRDs/done/. PRD-610 AC-16 stays open for the owner: cull and project stay on the main thread.
…e and player changes
|
The merge queue stopped on
Fix, push, re-enqueue. |
|
The merge queue stopped on
Fix, push, re-enqueue. |
|
The merge queue stopped on
Fix, push, re-enqueue. |
…its generated records Resolves the four conflicts develop's #577/#579 left against this branch, and recomputes the two generated records on the merged tree (neither parent's values are right for it). - .gitleaksignore: keep develop's allowlist entry for #574's kit-loop KPI field id (the branch had nothing there). - core-assets.mjs: union. This lane's idempotent `dispose()` (final release must not empty the reusable cache) plus develop's PRD-743 report surface (`cache`, `prefetch`, `startBackgroundFill`) that the playtest bridge's state sample reads. Both sides' new player-imports checks pass against it. - scaffold.spec.ts: recompute PRD_201_PARENT_SCAFFOLD_HASHES on the merged tree. The kits this lane touched (collectathon, adventure, kart, starter) are a third state, not either parent's; the untouched kits take develop's values. - native-coverage-2026-08-28.md: regenerated by `native:coverage` on the merged tree (48 contract targets executed, 3 blocked as configured). Source digest 22ac6e9e…; src/engine/ 83.90% against its 82.22% floor. Floor tables were identical on both sides. Verified locally on the merged tree: typecheck, lint, `budgets`, `check:docs`; unit phase 13,555 passed (17 failures are machine-only: 14 need Node 20 and pass under v20.19.6, 1 needed the Wasm engine and 2 the browser, both green once built); scaffold hash spec green; native C++ board green; Wasm engine 4,192,083 B against the 4 MiB budget (2,221 B under, this lane's 2,178 under held). Not re-run locally: the 21 runtime-native package tests that need the `build/tn-linux/*-test` targets, which `native:build` does not build — CI's test-native job owns them.



What is this PR about?
The native desktop player's main (game) thread does less work per frame. Two changes do this:
RenderDatabase::batchre-ranprojection::decideon every frame, with a full scene walk and regroup, only to read the skinned rigs' verdicts. The decision now holds while the scene structure (hierarchyVersion+structureStamp) and every rig's lane key (lane reason, similarity, mirror sign) hold. The 60-frame cadence still re-judges it.structureStampmoved intoprojection/plan.h, sohostProjectionReportand the renderer share one rule.TN_RENDER_THREAD=0turns it off, and a GPU timing run keeps it off.Also in this PR:
cache/prefetch/startBackgroundFill, so native playtest observations threwTN_INSPECT_GAME_BRIDGE … reading 'enabled'.developsince Hook reference search to the new data repository and its release shape #579.Why does it matter?
Midway (desktop, matched CPU, 3 alternating pairs against today's
developpath) runs 3.4 to 7.5 ms less main-thread CPU per frame at takeoff, cockpit and rear gunner. Instructions per frame fall from 40-48 M to 29-34 M (about −27%). Parity PASS in every run. The visual judge returns NEUTRAL at all three poses (sheets in the PR comment).Done (PRD-613,
prd:100%)native_engine_skinned_projecting_cadence: red then green.ctest -L native-engine516/517: the only red istarget_graph, from this checkout's UI-overlay configure.Still open, outside this PR